﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace RelationUsingAnnotations
{
    public class User
    {
        public int UserId { get; set; }
        public string Name { get; set; }
        //添加为Author的用户，关联的所有作者写的图书
        [InverseProperty("Author")]
        public List<Book> WrittenBooks { get; set; }

        //添加为Reviewer的用户，关联的所有审稿人复审的图书
        [InverseProperty("Reviewer")]
        public List<Book> ReviewedBooks { get; set; }

        //添加为ProjectEditor的用户，关联的所有编辑负责编辑的图书
        [InverseProperty("ProjectEditor")]
        public List<Book> EditedBooks { get; set; }
    }
}
